//
//  main.m
//  ESFS
//
//  Created by Markus Walther on 29.10.07.
//  Copyright __MyCompanyName__ 2007. All rights reserved.
//

#import <Cocoa/Cocoa.h>

/*int main(int argc, char *argv[])
{
    return NSApplicationMain(argc,  (const char **) argv);
}
*/
#import <Foundation/Foundation.h>

#import "NSArray_Extensions.h"
#import "CEasysharefsFileSystem.h"

#include <unistd.h>

int main(int argc, char **argv)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
//
NSMutableArray *theArguments = [NSMutableArray arrayWithArgv:argv argc:argc];



NSString *theMountPoint = NULL;
if (NO)
	{
	NSLog(@"replaceags");
	char theTemplate[] = "/tmp/ShadowFS_XXXXXXXX";
	theMountPoint = [NSString stringWithUTF8String:mkdtemp(theTemplate)];
	
	[theArguments removeObjectsInRange:NSMakeRange(1, [theArguments count] - 1)];
	[theArguments addObject:@"~/Movies"];
	[theArguments addObject:theMountPoint];
	[theArguments addObjectsFromArray:[@"-o ping_diskarb,volname=Test -f" componentsSeparatedByString:@" "]];
	if (NO)
		[theArguments addObject:@"-d"];
	}


NSString *theRootPath = [theArguments objectAtIndex:1];
[theArguments removeObjectAtIndex:1];

	NSLog(theRootPath);
for(int i=0;i < [theArguments count];++i)
	{
	NSLog([theArguments objectAtIndex:i]);
	}

CEasysharefsFileSystem *theFileSystem = [[[CEasysharefsFileSystem alloc] init] autorelease];
//[theFileSystem setRootPath:theRootPath];
[theFileSystem main:theArguments];

[pool release];
return 0;
}

